package com.hehe.controller;


import com.hehe.Dao.Delete_mapper;
import com.hehe.Dao.Update_mapper;
import org.json.JSONException;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value="/level")
public class Level {

    @Autowired
    private Update_mapper update_mapper;

    @PostMapping(value = "/level_300")
    @ResponseBody
    public String level_300(Model model, @RequestBody String json_data) throws JSONException {
        JSONObject jsonobj = new JSONObject(json_data);
        String id = (String) jsonobj.get("id");
        Integer integer = update_mapper.level_300(id);
        return "success";
    }


}




